<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <mate name="viewport" content="width=device-width, initial-scale=1.0"></mate>
    <title>图片分类管理</title>
<!--    <script src="../../static/js/jquery.js"></script>-->
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.5.0/dist/semantic.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/semantic-ui@2.5.0/dist/semantic.min.css" rel="stylesheet">
<!--    <link rel="stylesheet" href="../../static/css/me.css">-->
</head>
<body>
    <!--导航-->
    <nav th:replace="_fragments :: admin_menu(4)" class="ui inverted attached segment m-padded-tb-tiny">
        <div class="ui container">
            <div class="ui inverted stackable menu secondary ">
                <h2 class="ui teal header  item">广软社区</h2>
                <a href="#" class=" m-item item m-mobile-hide"><i class="small home icon"></i>博客</a>
                <a href="#" class="m-item item m-mobile-hide"><i class="small idea icon"></i>分类</a>
                <a href="#" class="m-item item m-mobile-hide"><i class="small tags icon"></i>标签</a>
                <div class="right menu m-item m-mobile-hide">
                    <div class="ui dropdown item">
                        <div class="text">
                            <img src="https://picsum.photos/seed/picsum/100/100" alt="" class="ui avatar image">
                            陈炯燏
                        </div>
                        <i class="dropdown icon"></i>
                        <div class="menu">
                            <a href="#" class="item">注销</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <a href="#" class="ui menu toggle black basic inverted m-top-right button m-mobile-show">
            <i class="sidebar icon" style="width: 0.1em"></i>
        </a>
    </nav>

    <!--中间内容-->
    <div class="m-container-small m-padded-tb-large m-height">
        <div class="ui container segment">
            <form action="#" method="post" th:object="${imageType}" th:action="*{id}==null ? @{/admin/addImageType} : @{/admin/imageType/{id}(id=*{id})}" class="ui form">

                <div class="field">
                    <div class="ui left labeled input">
                        <label class="ui teal basic label">名称</label>
                        <input type="text" name="name" placeholder="图片分类名称" th:value="*{name}">
                    </div>
                </div>

                <div class="ui error message"></div>
                <!--/*/
                <div class="ui negative message" th:if="${#fields.hasErrors('name')}">
                    <i class="close icon"></i>
                    <div class="header">验证失败：</div>
                    <p th:errors="*{name}">提交信息不符合规则</p>
                </div>
                /*/-->

                <div class="ui right aligned container">
                    <button class="ui button" onclick="window.history.go(-1)">返回</button>
                    <button class="ui submit teal button">提交</button>
                </div>

            </form>
        </div>
    </div>

    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>

    <!--底部footer-->
    <footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-max">
        <div class="ui center aligned container">
            <div class="ui inverted divided stackable grid">
                <div class="three wide column">
                    <div class="ui inverted list">
                        <div class="item">
                            <img src="../../static/images/scanner_picture.jpg" class="ui rounded image" alt="站长二维码" style="width: 120px;">
                        </div>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">最新博客</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item" > 用户故事（User Story）</a>
                        <a href="#" class="item" > 用户故事（User Story）</a>
                        <a href="#" class="item" > 用户故事（User Story）</a>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">联系我</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item" > Email:1718707267@qq.com</a>
                        <a href="#" class="item" > QQ:1718707267</a>
                    </div>
                </div>
                <div class="seven wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced ">ChenJionyu</h4>
                    <p class="m-text-thin m-text-spaced m-text-lined m-opacity-mini">这是我的个人博客，会分享关于编程、写作、思考、相关徳任何内容，希望可以给来到这儿的人有所帮助...</p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="m-text-thin m-text-spaced m-opacity-mini">Copyright ©2023 DaiYan Designed by ChenJiongyu </p>
        </div>
    </footer>

    <script>

        $(".menu.toggle").click(function (){
            $(".m-item").toggleClass("m-mobile-hide");
        })
        $(".ui.dropdown").dropdown({
            on:'hover'
        });
        $(".ui.form").form({
            fields:{
                name:{
                    identifier:"name11",
                    rules:[{
                        type:'empty',
                        prompt:'分类名不能为空'
                    }]
                }
            }
        })

        /*点击关闭关闭提示框*/
        $(".message .close").on("click",function () {
            $(this).closest('.message')
                .transition("fade");
        })
    </script>
</body>
</html>